from django.db import models

# Create your models here.



class UserId(models.Model):
    user_account = models.CharField(max_length = 20,unique = True)
    user_pswd = models.CharField(max_length = 20)


class UserMaterial(models.Model):
    #和用户关联
    user = models.ForeignKey(UserId, on_delete = models.CASCADE)

    #网名
    user_name = models.CharField(max_length = 20)

    #个性签名
    user_signature = models.CharField(max_length = 50,blank = True,null = True)

    #性别
    user_sex = models.CharField(max_length = 10,blank = True,null = True)

    #年龄
    user_age = models.CharField(max_length = 10,blank = True,null = True)

    #出生日期
    user_birth = models.DateField()


class Encrypted(models.Model):
    #和用户关联
    user = models.ForeignKey(UserId, on_delete = models.CASCADE)
    
    #密保问题
    question_text = models.CharField(max_length = 50)

    #密保答案
    question_answer = models.CharField(max_length = 30)
